//
//  ParentClassTableViewController.m
//  CoolTennisBall
//
//  Created by Coollang on 16/9/14.
//  Copyright © 2016年 CoolLang. All rights reserved.
//

#import "ParentClassTableViewController.h"

@interface ParentClassTableViewController ()<UIGestureRecognizerDelegate>

@property (nonatomic, assign)BOOL canScroll;

@end

@implementation ParentClassTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _canScroll = YES;
}

-(void)dealloc{
    
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    
}
 
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
    BOOL scroll = YES;
        if (scrollView.contentOffset.y > 20) {
            scroll = NO;
            // 头部不能滚动
        }else {
            // 头部能滚动
            scroll = YES;
        }
    
    if (scroll != self.canScroll) {
        self.canScroll = scroll;
        [[NSNotificationCenter defaultCenter] postNotificationName:@"leaveTop" object:nil userInfo:@{@"canScroll":@(self.canScroll).stringValue}];
    }
}

@end
